package com.czxy.tanhua.autoconfig.properties;

import com.baidu.aip.face.AipFace;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * @Author 爱吃豆的土豆、
 * @Date 2023/3/31 10:24
 */
@Data
@ConfigurationProperties(prefix = "tanhua.aip")
public class FaceProperties {
    private String appId;
    private String apiKey;
    private String secretKey;
    @Bean
    public AipFace aipFace(){
        AipFace client = new AipFace(appId, apiKey, secretKey);
        // 可选：设置网络连接参数
        client.setConnectionTimeoutInMillis(2000);
        client.setSocketTimeoutInMillis(60000);

        return client;
    }
}
